<template>
  <el-dialog
    title="提示"
    :visible.sync="dialogVisible"
    width="50%"
    >
    <el-form ref="form" :model="formData" size="small" label-width="120px">
      <el-form-item label="名称" required>
        <el-input v-model="formData.name"></el-input>
      </el-form-item>
      <el-form-item label="采集方式" required>
        <el-select v-model="formData.type" placeholder="请选择">
          <el-option label="本地" value="本地"></el-option>
          <el-option label="远程共享" value="远程共享"></el-option>
          <el-option label="远程FTP" value="远程FTP"></el-option>
          <el-option label="远程SFTP" value="远程SFTP"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="服务器IP" required>
        <el-input v-model="formData.serverIp"></el-input>
      </el-form-item>
      <el-form-item label="服务器端口" required>
        <el-input v-model="formData.serverPort"></el-input>
      </el-form-item>
      <el-form-item label="用户名" required>
        <el-input v-model="formData.userName"></el-input>
      </el-form-item>
      <el-form-item label="密码" required>
        <el-input v-model="formData.password"></el-input>
      </el-form-item>
      <el-form-item label="文件或目录" required>
        <el-input v-model="formData.fileUrl"></el-input>
      </el-form-item>
      <el-form-item label="是否包含子目录" required>
        <el-checkbox v-model="formData.hasChild"></el-checkbox>
      </el-form-item>
      <el-form-item label="传输模式" required>
        <el-input v-model="formData.transMode"></el-input>
      </el-form-item>
      <el-form-item label="服务器编码" required>
        <el-input v-model="formData.fileUrl"></el-input>
      </el-form-item>
      <el-form-item label="原始编码" required>
        <el-select v-model="formData.coding" placeholder="请选择">
          <el-option label="UTF-8" value="UTF-8"></el-option>
          <el-option label="UTF-16" value="UTF-16"></el-option>
          <el-option label="GBK" value="GBK"></el-option>
          <el-option label="ISO-8859-1" value="ISO-8859-1"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="时间间隔(秒)" required>
        <el-input v-model="formData.timeGap"></el-input>
      </el-form-item>
      <el-form-item label="状态">
        <el-radio-group v-model="formData.status">
          <el-radio label="1">启用</el-radio>
          <el-radio label="0">禁用</el-radio>
        </el-radio-group>
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      dialogVisible: false,
      formData: {
        name: '',
        type: '本地',
        fileUrl: '',
        coding: '',
        timeGap: '',
        status: '1'
      }
    }
  },
  methods: {
    init() {
      this.dialogVisible = true
    }
  }
}
</script>
